import VueRouter from 'vue-router'

//导入路由组件
 import HomeContainer from './components/tabbar/HomeContainer.vue'
 import MemberContainer from './components/tabbar/MemberContainer.vue'
 import SearchContainer from './components/tabbar/SearchContainer.vue'
 import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
 import NewsList from './components/news/NewsList.vue'
// import NewsInfo from './components/news/NewsInfo.vue'
// import Photolist from './components/photos/Photolist.vue'
// import Photoinfo from './components/photos/Photoinfo.vue'
import Goodslist from './components/goods/Goodlist.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodsComment from './components/goods/GoodsComment.vue'
import GoodsDesc from './components/goods/GoodsDesc.vue'

var router =new VueRouter({
  routes:[//配置路由规则
    {path:'/',redirect:'/home'},
    {path:'/home',component:HomeContainer},
    {path:'/member',component:MemberContainer},
    {path:'/shopcar',component:ShopcarContainer},
    {path:'/search',component:SearchContainer},
    {path:'/home/newslist',component:NewsList},
    // {path:'/home/newslist/:id',component:NewsInfo},
    {path:'/home/goodslist',component:Goodslist},
    // {path:'/home/photolist',component:Photolist},
    // {path:'/home/photoinfo/:id',component:Photoinfo}
    // {path:'/home/goodsinfo:id',component:GoodsInfo}

    // 下面是编程式导航
    {path:'/home/goodsinfo/:id',component:GoodsInfo,name:'goodsinfo'},
    {path:'/home/goodscomment/:id',component:GoodsComment,name:'goodscomment'},
    {path:'/home/goodsdesc/:id',component:GoodsDesc,name:'goodsdesc'}

    
  ],
  linkActiveClass:'mui-active'//覆盖默认路由高亮的类
})

export default router

